 <!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> - 基础表格</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <include file="Index/common_css"/>
    <link href="__PUBLIC__/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <!-- Data Tables -->
    <link href="__PUBLIC__/admin/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
    <style>
        .download{float:right;}
        .fa-pencil,.fa-trash{font-size:16px;}
    </style>
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>外佣账号设置</h5>
                    </div>
                    <div class="ibox-content">
                        <div class="row" style="border-bottom:1px solid #CCC;margin-bottom:10px;">
                            <button type="button" class="btn btn-outline btn-info" onclick="account_add('添加账户','__URL__/addFdshView/type/1','800','400')">添加账号</button>
                        </div>
                        <div class="table-responsive">
                            <table class="table table-striped table-bordered table-hover dataTables-example">
                                <thead>
                                    <tr>
                                        <th></th>
                                        <th>ID</th>
                                        <th>账号</th>
                                        <th>金额</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody class="list">
                                <volist name="list" id="va">
                                    <tr>
                                        <td>
                                            <input type="checkbox" class="i-checks" name="input[]">
                                        </td>
                                        <td>{$va.id}</td>
                                        <td>{$va.account}</td>
                                        <td>{$va.money}</td>
                                        <td class="text-center">
                                            <a><i class="fa fa-pencil" onclick="updateAccount('修改账户','__URL__/updateFdshView/id/{$va.id}','800','400')"></i></a>&nbsp;&nbsp;
                                            <a><i class="fa fa-trash" onclick="delAccount('{$va.id}')"></i></a>
                                        </td>
                                    </tr>
                                </volist>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 全局js -->
    <include file="Index/common_js"/>
    <!-- 自定义js -->
    <script src="__PUBLIC__/admin/js/content.js?v=1.0.0"></script>
    <script src="__PUBLIC__/common/js/layer_show.js"></script>
    <!-- Data Tables -->
    <script src="__PUBLIC__/admin/js/plugins/dataTables/jquery.dataTables.js"></script>
    <script src="__PUBLIC__/admin/js/plugins/dataTables/dataTables.bootstrap.js"></script>
<!--时间插件-->
    <script src="__PUBLIC__/admin/js/plugins/layer/laydate/laydate.js"></script>
    <script>
        $(document).ready(function () {
            $('.dataTables-example').dataTable();
            laydate({
                elem: '#from', /*目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'*/
                event: 'focus', /*响应事件。如果没有传入event，则按照默认的click*/
                //format: 'YYYY-MM-DD hh:mm:ss',
            });
            laydate({
                elem: '#to', /*目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'*/
                event: 'focus' /*响应事件。如果没有传入event，则按照默认的click*/
            });
        });

        var index;
        function updateAccount(title, url, w, h){
            layer_show(title, url, w, h);
        }

        function account_add(title, url, w, h){
            layer_show(title, url, w, h);
        }

        function delAccount(id){
            layer.confirm("您确定要删除吗?",function(){
                var load=layer.load();
                $.ajax({
                    type:"POST",
                    url:"__URL__/deleteFdsh",
                    dataType:'json',
                    data:{id:id},
                    success:function(data){
                        layer.close(load);
                        //alert(JSON.stringify(data));return;
                        if(data.status ==1){
                            layer.msg(data.msg, {icon: 1, time: 2000});
                            location.reload();
                        }else{
                            layer.msg(data.msg, {icon: 2, time: 2000});
                        }
                    },error:function(err){
                        layer.msg('网络错误',{icon: 2, time: 2000});
                        console.log(err);
                    }
                });
            })
        }
    </script>
</body>
</html>
